import {Component, OnInit} from '@angular/core';

@Component({
  selector: 'app-backview',
  templateUrl: './backview.component.html',
  styleUrls: ['./backview.component.css']
})
export class BackviewComponent implements OnInit {
  date;
  userm = false;
  categorym = false;
  goodsm = false;
  orderm = false;
  name;

  constructor() {
    this.name = localStorage.getItem('name');
  }

  ngOnInit() {
    setInterval(() => {
      this.showTime();
    }, 1000);
  }

  showTime() {
    this.date = new Date();
  }

  go(show: string) {
    console.log("coming");
    switch (show) {
      case 'userm':
        this.initGo();
        this.userm = true;
        break;
      case 'categorym':
        this.initGo();
        this.categorym = true;
        break;
      case 'goodsm':
        this.initGo();
        this.goodsm = true;
        break;
      case 'orderm':
        this.initGo();
        this.orderm = true;
        break;

    }

  }

  initGo() {
    this.orderm = false;
    this.goodsm = false;
    this.categorym = false;
    this.userm = false;
  }
}
